package leetcode;

import java.util.Scanner;

/**
 * ClassName: HengshengT1
 * Package: leetcode
 * Description:
 *
 * @Author wjn
 * @Create 2025/10/10 19:50
 * @Version 1.0
 */
public class HengshengT1 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int ans = scanner.nextInt();
        int a = scanner.nextInt();
        int b = scanner.nextInt();

        int queryCount = 0;
        int guessCount = 0;
        boolean isWin = false;

        for (int i = 0; i < n; i++) {

            char op = scanner.next().charAt(0);
            int x = scanner.nextInt();

            if (op == '?') {
                queryCount++;
            } else if (op == '!') {
                guessCount++;
                if (x == ans) {
                    isWin = true;
                    break;
                }
            }
        }
        if (isWin && queryCount <= a && guessCount <= b) {
            System.out.println("yes");

        }else{
            System.out.println("no");
        }

        scanner.close();
    }
}
